/*
 *      gconf.cpp
 *
 *      Copyright 2010 AzureSky <AzureSky.fedora@gmail.com>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

#include "gconf.h"

gconf::gconf()
{
	gconf_client = gconf_client_get_default();
}

gconf::~gconf()
{
	g_object_unref(gconf_client);
}

int gconf::get_int(const char* key)
{
	return gconf_client_get_int(gconf_client,key,NULL);
}

bool gconf::set_int(const char* key,int value)
{
	return gconf_client_set_int(gconf_client,key,value,NULL);
}

double gconf::get_float(const char* key)
{
	return gconf_client_get_float(gconf_client,key,NULL);
}

bool gconf::set_float(const char* key,double value)
{
	return gconf_client_set_float(gconf_client,key,value,NULL);
}

bool gconf::get_bool(const char* key)
{
	return gconf_client_get_bool(gconf_client,key,NULL);
}

bool gconf::set_bool(const char* key,bool value)
{
	return gconf_client_set_bool(gconf_client,key,value,NULL);
}

std::string gconf::get_string(const char* key)
{
	return gconf_client_get_string(gconf_client,key,NULL);
}

bool gconf::set_string(const char* key,std::string value)
{
	return gconf_client_set_string(gconf_client,key,value.c_str(),NULL);
}

bool gconf::set_string(const char* key,const char* value)
{
	return gconf_client_set_string(gconf_client,key,value,NULL);
}

